.syntax unified                 		  /*统一指令集语法*/
.cpu cortex-m3                  		  /*指定目标处理器*/
.thumb                          		  /*类似于.code 16,选择使用thumb指令集*/

.equ RCC_APB2ENR, 0x40021018              /*定义寄存器地址*/
.equ GPIOC_CRL, 0x40011000
.equ GPIOC_ODR, 0x4001100c

.global test_led
.text
.type test_led, %function
test_led:
/*使能GPIO C端口时钟*/
	ldr r0, =RCC_APB2ENR
	ldr r1, =0x00000010
	ldr r2, [r0,#0]
	orr r2, r1
	str r2, [r0,#0]
/*配置GPIO端口C*/
	ldr r0, =GPIOC_CRL
	ldr r1, =0x33333333
	str r1, [r0,#0]
/*GPIO端口C输出数据，熄灭LED*/
	ldr r0, =GPIOC_ODR
	ldr r1, =0x000000ff
	ldr r2, [r0,#0]
	orr r2, r1
	str r2,[r0,#0]
/*GPIO端口C输出数据，点亮LED*/
	ldr r0, =GPIOC_ODR
	ldr r1, =0xffffff00
	ldr r2, [r0,#0]
	and r2, r1
	str r2,[r0,#0]
/*返回*/
	bx lr
/*文件结束*/
	.end
